package org.cxn.netty.tools;

import io.netty.channel.Channel;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import io.netty.util.concurrent.GlobalEventExecutor;


/**
 * Created by chenxiangning on 2015/9/1.
 */
public class Global {
    public static ChannelGroup group =
            new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);

    public static void main(String[] args) {
        System.out.println(group.size());
        for (Channel channel : group) {
            channel.writeAndFlush(new TextWebSocketFrame("{sdsd:\"dddd\",sd:\"说的\"}"));
        }
    }
}